<%@ page import="org.codehaus.groovy.grails.plugins.ofchart.demo.DemoCharts" contentType="text/html;charset=UTF-8" %>
<html>
  <head>
    <title>Burn Down Chart</title>
    <link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" />
    <link rel="stylesheet" href="${resource(dir:'css',file:'mycss.css')}" />
    <link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
  <g:javascript library="application" />
  
</head>
    <ofchart:resources/>
  <g:javascript library="prototype"/>  

<body>
  <div id="spinner" class="spinner" style="display:none;">
    <img src="${resource(dir:'images',file:'spinner.gif')}" alt="Spinner" />
  </div>
  <div id="grailsLogo" class="logo"><a href="${createLink(uri: '/')}"><img src="${resource(dir:'images',file:'grails_logo.png')}" alt="Grails" border="0" /></a></div>
  <div id="nav">
    <div class="homePagePanel">
      <div class="panelTop">

      </div>
      <div class="panelBody">
      <g:isLoggedIn>
      	 		<div class="welcomelogin">
      	 		<b>Hello <%=session.username %></b><br/>
      	 		</div>
      	 </g:isLoggedIn> 	
        <a href="${createLink(uri: '/')}"><h1>Home</h1></a>

        <g:ifAllGranted role="ROLE_ADMIN">
          <g:link controller="page" action="index"><h1>Admin Pages</h1></g:link>
          <ul>
            <li><g:link controller="project" action="index">Manage Project</g:link></li>
            <li><g:link controller="task" action="index">Manage Task</g:link></li>
            <li><g:link controller="subTask" action="index">Manage Subtask</g:link></li>
            <li><g:link controller="requestmap" action="index">Manage Request Map</g:link></li>
            <li><g:link controller="projectTeam" action="index">Manage Project Team</g:link></li>
            <li><g:link controller="user" action="index">Manage Team Member</g:link></li>
          </ul>

          <g:link controller="page" action="team"><h1>Team Member pages</h1></g:link>
          <ul>
            <li><g:link controller="user" action="list">Manage Profile</g:link></li>
            <li><g:link controller="project" action="list">Project List</g:link></li>
            <li><g:link controller="task" action="list">Task List</g:link></li>
            <li><g:link controller="subTask" action="list">Subtask List</g:link></li>
            <li><g:link controller="pspData" action="list">Show PSP Data</g:link></li>
            <li><g:link controller="pspData" action="show">PSP Data List</g:link></li>
          </ul>
        </g:ifAllGranted>
        <g:ifAllGranted role="ROLE_TEAM">
          <g:link controller="page" action="index"><h1>Team Member Pages</h1></g:link>
          <ul>
            <li><g:link controller="user" action="show">Manage Profile</g:link></li>
            <li><g:link controller="project" action="list">Project List</g:link></li>
            <li><g:link controller="task" action="list">Task List</g:link></li>
            <li><g:link controller="subTask" action="list">Subtask List</g:link></li>
            <li><g:link controller="upload" action="index">Upload PSP Data</g:link></li>
            <li><g:link controller="pspData" action="list">Show PSP Data</g:link></li>            
          </ul>
        </g:ifAllGranted>
        <g:isLoggedIn>
          <g:link controller="logout"><h1>Logout</h1></g:link>
        </g:isLoggedIn>
        <g:isNotLoggedIn>
          <g:link controller="login"><h1>Login</h1></g:link>
        </g:isNotLoggedIn>

      </div>
      <div class="panelBtm">
      </div>
    </div>


  </div>
  <div id="pageBody">
    <div class="nav">
      <span class="menuButton"><a class="home" href="${createLink(uri: '/pspData')}">PSP Data</a></span>
    </div>
    <div>
      <br />
      <h1>Burn Down Chart</h1>
    <br/>
    <g:link action="burn_down_chart_page" params="[chartType: 'team',projectId: session.project.id]">Team Burn Down Chart</g:link> | 
    <g:link action="burn_down_chart_page" params="[chartType: 'personal',projectId: session.project.id]">Personal Burn Down Chart</g:link> 
    <br/>
    <br/>
     
    <table>
    	<tr>
    	<td>
    	<ofchart:chart name="demo-chart" url="${createLink(action:'burn_down_chart')}" width="800" height="400"/>
    	</td>
    	<td>
    	 	<%if(params.chartType=="personal"){ %>
    		
    		<table>
			<g:each in="${team}" status="i" var="t">
				<tr>
					<td bgcolor=${colorCode[i]} width="50"></td>
					<td>${t.user.userRealName }</td>
				</tr>
			</g:each>
			</table>
			<%} %>
			   
    	</td>
    	</tr>
    </table>
    </div>
    
  </body>
</html>